package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.MesOrderPositionRecordMapper;
import com.ruoyi.order.domain.MesOrderPositionRecord;
import com.ruoyi.order.service.IMesOrderPositionRecordService;

/**
 * 仓位占用记录Service业务层处理
 * 
 * @author guoxl
 * @date 2025-04-17
 */
@Service
public class MesOrderPositionRecordServiceImpl implements IMesOrderPositionRecordService 
{
    @Autowired
    private MesOrderPositionRecordMapper mesOrderPositionRecordMapper;

    /**
     * 查询仓位占用记录
     * 
     * @param id 仓位占用记录主键
     * @return 仓位占用记录
     */
    @Override
    public MesOrderPositionRecord selectMesOrderPositionRecordById(Long id)
    {
        return mesOrderPositionRecordMapper.selectMesOrderPositionRecordById(id);
    }

    /**
     * 查询仓位占用记录列表
     * 
     * @param mesOrderPositionRecord 仓位占用记录
     * @return 仓位占用记录
     */
    @Override
    public List<MesOrderPositionRecord> selectMesOrderPositionRecordList(MesOrderPositionRecord mesOrderPositionRecord)
    {
        return mesOrderPositionRecordMapper.selectMesOrderPositionRecordList(mesOrderPositionRecord);
    }

    /**
     * 新增仓位占用记录
     * 
     * @param mesOrderPositionRecord 仓位占用记录
     * @return 结果
     */
    @Override
    public int insertMesOrderPositionRecord(MesOrderPositionRecord mesOrderPositionRecord)
    {
        mesOrderPositionRecord.setCreateTime(DateUtils.getNowDate());
        return mesOrderPositionRecordMapper.insertMesOrderPositionRecord(mesOrderPositionRecord);
    }

    /**
     * 修改仓位占用记录
     * 
     * @param mesOrderPositionRecord 仓位占用记录
     * @return 结果
     */
    @Override
    public int updateMesOrderPositionRecord(MesOrderPositionRecord mesOrderPositionRecord)
    {
        mesOrderPositionRecord.setUpdateTime(DateUtils.getNowDate());
        return mesOrderPositionRecordMapper.updateMesOrderPositionRecord(mesOrderPositionRecord);
    }

    /**
     * 批量删除仓位占用记录
     * 
     * @param ids 需要删除的仓位占用记录主键
     * @return 结果
     */
    @Override
    public int deleteMesOrderPositionRecordByIds(Long[] ids)
    {
        return mesOrderPositionRecordMapper.deleteMesOrderPositionRecordByIds(ids);
    }

    /**
     * 删除仓位占用记录信息
     * 
     * @param id 仓位占用记录主键
     * @return 结果
     */
    @Override
    public int deleteMesOrderPositionRecordById(Long id)
    {
        return mesOrderPositionRecordMapper.deleteMesOrderPositionRecordById(id);
    }
}
